/*
    Superjuego Engine
    Copyright (C) 2011 Jorge Luís Cabral y Gabriel Ernesto Cabral

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the Free
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

    Contact: baigosoft@hotmail.com
*/

#ifndef ANIMATION_H_
#define ANIMATION_H_

#include <stdio.h>
#include <stdlib.h>

#include "super.h"

/*#ifdef DREAMCAST
	#include "render.h"
#else
	#include "render.h"
	#include <SDL/SDL.h>
#endif*/

#define START 1
#define STOP 0


typedef struct
{

	SE_image *image;
	int delay;
	float xt,yt,wt,ht;

	
}SE_frame;

typedef struct
{
	SE_frame *fr;
	int numframes;
	int x,y,z;	

}SE_ani;

typedef struct
{

	SE_ani *ani;

	
/*transformaciones*/
	float delayperc;/*porcentaje de delay*/
	

/*estado*/
	int status;
	int counter;
	int currentframe;

}SE_animator;


/*animation*/
SE_ani *SE_ani_init();
void SE_ani_addframe_segment(SE_ani *ani,SE_image *img,int delay,float xtex,float ytex,float wtex,float htex);
void SE_ani_addframe(SE_ani *ani,SE_image *img,int delay);
void SE_ani_clean(SE_ani *ani);

/*animator*/
SE_animator *SE_animator_init(SE_ani *ani);

/*animator draw*/
void SE_animator_draw_effects(SE_animator *ator,float posx,float posy,float posz,float zoomx,float zoomy,float rotx,float roty,float rotz,float r,float g,float b,float alpha);
void SE_animator_draw(SE_animator *ator,float posx,float posy,float posz);

/*animator control*/
void SE_animator_start(SE_animator *ator);
void SE_animator_stop(SE_animator *ator);
void SE_animator_startat(SE_animator *ator,int currentframe);
void SE_animator_delaypercent(SE_animator *ator,float delay_perc);












#endif

